import request from '@/utils/request'

// 查询电销管理信息列表
export function listElectric(query) {
  return request({
    url: '/electric/electric/list',
    method: 'get',
    params: query
  })
}

export function listElectricPerson(query) {
  return request({
    url: '/electric/electric/personList',
    method: 'get',
    params: query
  })
}

// 查询电销管理信息详细
export function getElectric(electricId) {
  return request({
    url: '/electric/electric/' + electricId,
    method: 'get'
  })
}

// 新增电销管理信息
export function addElectric(data) {
  return request({
    url: '/electric/electric',
    method: 'post',
    data: data
  })
}

// 修改电销管理信息
export function updateElectric(data) {
  return request({
    url: '/electric/electric',
    method: 'put',
    data: data
  })
}

// 删除电销管理信息
export function delElectric(electricId) {
  return request({
    url: '/electric/electric/' + electricId,
    method: 'delete'
  })
}
//树结构
export function treeElectric(){
  return request({
    url:'/electric/electric/electricType',
    method:'get'
  })
}
//修改主分类
export function updateClass(data){
  return request({
    url:"/electric/electric/updateClass",
    method:'post',
    data:data
  })
}
export function editBusinessManager(data) {
  return request({
    url: "/electric/electric/editBusinessManager",
    method: "post",
    data
  });
}

export function returnEle(id) {
  return request({
    url: "/electric/electric/return/"+id,
    method: "get"
  });
}

export function convert(electricId){
  return request({
    url: '/electric/electric/convert/'+electricId,
    method: 'get',
  })
}
//查询所有电销人员
export function listAllPerson() {
  return request({
    url: '/electric/electric/personListAll',
    method: 'get'
  })
}

